package com.lingo.a2b.model.bo;

import com.lingo.a2b.model.vo.FieldInfoVo;
import lombok.Getter;
import lombok.Setter;
import org.springframework.util.CollectionUtils;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author lingo
 * @date 2020/5/21 16:31
 * @Company: www.xyb2b.com
 */
@Setter
@Getter
public class ClassInfo {

    private String shortName;

    private String fullName;

    private String packageName;

    private String superClass;

    private List<FieldInfo> fieldInfoList;

    public List<FieldInfoVo> toFieldInfoVo(int projectId){
        if (CollectionUtils.isEmpty(fieldInfoList)){
            return null;
        }
        return fieldInfoList.stream().map(info -> info.toVo(projectId)).collect(Collectors.toList());
    }

}
